home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ksslx509map.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.1 KB  |  87 lines

  1. /* This file is part of the KDE project
  2.  *
  3.  * Copyright (C) 2000-2003 George Staikos <staikos@kde.org>
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Library General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Library General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Library General Public License
  16.  * along with this library; see the file COPYING.LIB.  If not, write to
  17.  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.  * Boston, MA 02110-1301, USA.
  19.  */
  20.  
  21. #ifndef _KSSLX509MAP_H
  22. #define _KSSLX509MAP_H
  23.  
  24. #include <qmap.h>
  25. #include <qstring.h>
  26.  
  27. #include <kdelibs_export.h>
  28.  
  29. /**
  30.  * X.509 Map Parsing Class
  31.  *
  32.  * This class is used to parse and store a map as used in X.509 certificates.
  33.  * It is of the form /name=value/name=value/name=value
  34.  *
  35.  * @author George Staikos <staikos@kde.org>
  36.  * @see KSSL, KSSLCertificate
  37.  * @short X.509 Map Parser
  38.  */
  39. class KIO_EXPORT KSSLX509Map {
  40. public:
  41.     /**
  42.      *  Construct an X.509 Map
  43.      *
  44.      *  @param name the map to parse
  45.      */
  46.     KSSLX509Map(const QString& name);
  47.  
  48.     /**
  49.      *  Destroy this map
  50.      */
  51.     ~KSSLX509Map();
  52.  
  53.     /**
  54.      *  Set a value in the map
  55.      *
  56.      *  @param key the key
  57.      *  @param value the value
  58.      */
  59.     void setValue(const QString& key, const QString& value);
  60.  
  61.     /**
  62.      *  Get the value of an entry in the map
  63.      *
  64.      *  @param key the key
  65.      *
  66.      *  @return the value
  67.      */
  68.     QString getValue(const QString& key) const;
  69.  
  70.     /**
  71.      *  Reset (clear) the internal storage.
  72.      *
  73.      *  @param name if this is not empty, it will be parsed and used as
  74.      *         the new map internally
  75.      */
  76.     void reset(const QString& name = "");
  77.   
  78. private:
  79.     class KSSLX509MapPrivate;
  80.     KSSLX509MapPrivate *d;
  81.     QMap<QString, QString> m_pairs;
  82.  
  83.     void parse(const QString& name);
  84. };
  85.  
  86. #endif
  87.